import 'package:dio/dio.dart';
import 'package:flutter_app/utils/utils.dart';

/// header拦截器
class HeaderInterceptors extends InterceptorsWrapper {
  @override
  onRequest(RequestOptions options) async {
    Map<String, dynamic> header = {
      "Accept-Language":
          await Utils.getCurrentLangType() == 'hi' ? 'hi' : 'en'
    };
    options.headers = header;

    ///超时
    options.connectTimeout = 15000;

    return options;
  }
}
